package com.gxa.service.user.impl;

import com.gxa.entity.user.User;
import com.gxa.entity.request.UserLoginRequest;
import com.gxa.mapper.user.SysMenuMapper;
import com.gxa.mapper.user.SysRoleMapper;
import com.gxa.mapper.user.UserMapper;
import com.gxa.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl  implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private SysMenuMapper menuMapper;

    @Autowired
    private SysRoleMapper roleMapper;


    @Override
    public User login(String userName, String pwd) {
        User user = this.userMapper.queryByUserNameAndPwd(userName,pwd);
        return user;
    }

    @Override
    public User login(UserLoginRequest user) {
        return  this.userMapper.queryByUserNameAndPwd(user.getUserName(),user.getPwd());
    }

    @Override
    public User queryByUserName(String userName) {
        return this.userMapper.queryByUserName(userName);
    }
}
